package com.lsp.java.design.observer.oil;

import java.util.Observable;

/**
 * @Auther: Lisp
 * @Date: 2019/1/17 16:24
 * @Description: 具体目标类：原油期货
 */
public class OilFutures extends Observable {

    private float price;

    public float getPrice() {
        return price;
    }

    public void setPrice(float price) {
        super.setChanged(); //设置内部标志位，注明数据发生变化
        super.notifyObservers(price);  //通知观察者价格改变了
        this.price = price;
    }
}
